package com.xxg.renrenuser.controller;

import com.xxg.renrencommon.domain.result.BaseResult;
import com.xxg.renrenuser.dao.RenrenShopUserProfile;
import com.xxg.renrenuser.dao.bean.ExpressAddressInfo;
import com.xxg.renrenuser.domain.query.AddAddressQuery;
import com.xxg.renrenuser.domain.query.DeleteAddressQuery;
import com.xxg.renrenuser.domain.query.EditAddressQuery;
import com.xxg.renrenuser.domain.result.RenrenShopProfileResult;
import com.xxg.renrenuser.service.AddressService;
import com.xxg.renrenuser.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户管理接口
 *
 * @author xxg
 * @date 2020/10/21
 */
@Api(tags = "用户管理接口")
@RestController
@RequestMapping("/user")
public class UserController {
    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @ApiOperation("获取用户信息")
    @RequestMapping(value = "getUserProfile", method = RequestMethod.GET)
    public BaseResult<RenrenShopProfileResult> getUserProfile(HttpServletRequest request) {
        String userId = request.getHeader("userId");
        String shopId = request.getHeader("shopId");
        return userService.getUserProfile(shopId, userId);
    }
}
